<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html; charset=UTF-8"%>

<jsp:useBean id="user" class="model.User" scope="session" />

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Izaberite prevoznika</title>
</head>
<body>

	<h1>Izaberite prevoznika</h1>

	<%
		if (user != null && user.isLoggedIn() || !user.isAdmin()) {
	%>

	<form action="/admin" method="get">

		<select name="ID">
			<c:forEach var="prev" items="${sessionScope.sviPrevoznici}">
				<option value="${prev.sifra.id}">${prev.naziv}</option>
			</c:forEach>
		</select>

		<td><input type="hidden" name="showCarrier" value="true"></td>		
		<input type="submit" value="Prikaži">

	</form>
	<%
		} else {
	%>
	<p>
		Niste se prijavili! <br> <a href="/logIn">Prijavi se</a>
	</p>
	<%
		}
	%>

	<p>
		<a href="/admin">Red voznje</a> <br> <a href="/logIn?logOff=true">Odjava</a>
	</p>

</body>
</html>
